#!/bin/bash
# 项目环境设置脚本

set -e

echo "=========================================="
echo "Triton Performance Testing Setup"
echo "=========================================="

# 检查Python版本
python_version=$(python3 --version 2>&1 | awk '{print $2}')
echo "Python version: $python_version"

# 检查CUDA是否可用
if command -v nvidia-smi &> /dev/null; then
    echo "NVIDIA GPU detected:"
    nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
elif command -v rocm-smi &> /dev/null; then
    echo "AMD ROCm GPU detected:"
    rocm-smi --showproductname
else
    echo "Warning: No GPU detected"
fi


echo ""
echo "=========================================="
echo "Check completed!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Download models: make download"
echo "2. Run PyTorch training: make train-pytorch"
echo "3. Run Triton training: make train-triton"
echo "4. Compare results: make compare"
echo ""
echo "For multi-GPU training:"
echo "  NUM_GPUS=4 make train-pytorch-multi"
echo "  NUM_GPUS=4 make train-triton-multi"
echo ""

